package com.ithuameng.admin.app.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ithuameng.admin.app.system.model.DictData;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Dict data mapper
 *
 * @author ithuameng
 */
public interface DictDataMapper extends BaseMapper<DictData> {

    /**
     * 根据字典类型查询字典数据
     *
     * @param dictType 字典类型
     * @return 字典数据集合信息
     */
    @Select({
            "<script>",
            "select id, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark from t_dict_data",
            "WHERE deleted='N' and dict_type = #{dictType} order by dict_sort asc",
            "</script>"
    })
    List<DictData> selectDictDataByType(String dictType);
}
